var t = require("../../../../@babel/runtime/helpers/interopRequireDefault"),
    e = require("../../../../@babel/runtime/helpers/defineProperty"),
    a = require("../../../../@babel/runtime/helpers/toConsumableArray"),
    i = require("../../../../@babel/runtime/helpers/typeof"),
    n = t(require("./NumberAnimate")),
    o = require("../../../../ec-canvas/echarts"),
    s = require("../../../../utils/themeSkin/skinBehavior"),
    r = getApp(),
    h = require("../../../../host");

Page({
    behaviors: [s],
    data: {
        show_member_id: "",
        language: "",
        userInfo: {},
        extension: [],
        unextension: [],
        share_page: !1,
        showEarning: !1,
        template: "",
        firstshow: !1,
        loginshow: !1,
        name_of_withdrawal: "提现",
        is_show_limit: !1,
        is_show_performance: !1,
        amount_num: 0,
        TemplateArray: [],
        income_statistic_type: "",
        income_statistic_type_box: [{
            type: "",
            title: "全部"
        }, {
            type: "1",
            title: "今日"
        }, {
            type: "2",
            title: "昨日"
        }, {
            type: "3",
            title: "本周"
        }, {
            type: "4",
            title: "上周"
        }, {
            type: "5",
            title: "本月"
        }, {
            type: "6",
            title: "上月"
        }],
        charts_type: "",
        fans_type: "",
        extension_type: "",
        available_type: "",
        income_page: "",
        background_color: "",
        income_statistic: [],
        income_dynamic: {},
        fans_fission: {},
        extension_order: {},
        isLoadMore: !0,
        clientWidth: "375",
        clientHeight: "",
        service: "",
        showPopup: !1,
        btnFlag: !1,
        btnData: {
            button_size: 40,
            over_top: 500,
            position_location: "right",
            icon_url: ""
        },
        ecIncome: {
            lazyLoad: !0
        },
        ecFans: {
            lazyLoad: !0
        },
        moreIdentity: !1,
        showLineChats: !1,
        showChatsLineHeight: 0,
        showChats: !1,
        showChatsHeight: 0,
        isshow: !1,
        editMemberPopupShow: !1,
        agentK1: 0, //新康丽尔--代理商区域
        agentK2: 0, //新康丽尔--一级市场区域
        agentK3: 0, //新康丽尔--二级市场区域

        isTab: false,

        fuShow:false,
        fuAll:0,
        fuzhaoshang:0,
        fushouyin:0,
        fuziti:0,
        fumendian:0,

    },
    onLoad: function (t) {
        this.setData({
            clientWidth: wx.getSystemInfoSync().windowWidth,
            clientHeight: wx.getSystemInfoSync().windowHeight
        });
        // let de = wx.getStorageSync('new_decorate').item
        // if(de && de.uniacid == "96"){
        //     this.setData({
        //         isTab:true
        //     })
        // }
        if(h.uniacid == "103"){
            this.setData({
                fuShow:true
            })
        }
    },

    closePopup: function () {
        this.setData({
            showPopup: !1
        });
    },
    onPageScroll: function (t) {
        "01" == this.data.template && (this.data.showChatsLineHeight >= 30 && (t.scrollTop > this.data.showChatsLineHeight ? this.data.showLineChats || (this.setData({
            showLineChats: !0
        }), 1 == this.data.charts_type ? this.initPieEcharts() : this.initEcharts()) : this.data.showLineChats && this.setData({
            showLineChats: !1
        })), t.scrollTop > this.data.showChatsHeight ? this.data.showChats || (this.setData({
            showChats: !0
        }), 1 == this.data.fans_type ? this.initOrderEcharts() : this.initFansEcharts()) : this.data.showChats && this.setData({
            showChats: !1
        })), t.scrollTop > 80 ? this.data.btnFlag || this.setData({
            btnFlag: !0
        }) : this.data.btnFlag && this.setData({
            btnFlag: !1
        });
    },
    onReady: function () {
        var t = wx.getStorageSync("langIndex");
        this.setData({
            language: t.en
        });
    },
    onShow: function () {
        var t = this;
        try {
            var e = function () {
                var e = wx.getStorageSync("yz_basic_info");
                t.setData({
                    background_color: e.theme_color || "#ffc11e"
                });
                for (var a = e.popularize_page.mini.vue_route, i = 0; i < a.length; i++)
                    if ("extension" == a[i]) return console.log(e.popularize_page.mini.mini_url + "跳转的路径"),
                        wx.showToast({
                            title: "未开启推广权限",
                            duration: 2e3,
                            icon: "none",
                            success: function () {
                                console.log(e.popularize_page.mini.mini_url), r._isTextEmpty(e.popularize_page.mini.mini_url) ? setTimeout(function () {
                                    wx.reLaunch({
                                        url: "/packageG/index/index"
                                    });
                                }, 1e3) : setTimeout(function () {
                                    wx.redirectTo({
                                        url: e.popularize_page.mini.mini_url
                                    });
                                }, 1e3);
                            }
                        }), {
                            v: void 0
                        };
            }();
            if ("object" === i(e)) return e.v;
        } catch (t) {
            console.log(t);
        }
        this.firstlogin() || (this._getExtensionData(), this.customizeIncome());
        if (h.uniacid == "96") {
            this.setData({
                isTab: true
            })
        }
    },
    onReachBottom: function () {
        this.data.isLoadMore && "01" == this.data.template && this.getMoreData();
    },
    onShareAppMessage: function () {
        var t = wx.getStorageSync("yz_uid"),
            e = "";
        return t && (e = t), {
            path: "/packageG/pages/member/extension/extension?mid=" + e
        };
    },
    onShareTimeline: function () {},
    initEcharts: function () {
        var t = this.selectComponent("#echats-income"),
            e = Math.ceil(Math.max.apply(Math, a(this.data.income_dynamic.total_amount))) || 50,
            i = Math.max.apply(Math, a(this.data.income_dynamic.income_count)) || 50,
            n = e / 5 || 5,
            s = i / 5 || 5,
            r = {
                tooltip: {
                    trigger: "axis",
                    axisPointer: {
                        type: "cross",
                        crossStyle: {
                            color: "#999"
                        }
                    }
                },
                toolbox: {
                    feature: {
                        magicType: {
                            show: !0,
                            type: ["line", "bar"]
                        },
                        saveAsImage: {
                            show: !0
                        }
                    }
                },
                legend: {
                    data: ["金额", "笔数"]
                },
                xAxis: [{
                    type: "category",
                    data: this.data.income_dynamic.x_axis,
                    axisPointer: {
                        type: "shadow"
                    }
                }],
                yAxis: [{
                    type: "value",
                    name: "金额",
                    min: 0,
                    max: e,
                    interval: n
                }, {
                    type: "value",
                    name: "笔数",
                    min: 0,
                    max: i,
                    interval: s
                }],
                series: [{
                    name: "金额",
                    type: "bar",
                    color: "#3b84f2",
                    data: this.data.income_dynamic.total_amount
                }, {
                    name: "笔数",
                    type: "line",
                    yAxisIndex: 1,
                    color: "#ffc11e",
                    data: this.data.income_dynamic.income_count
                }]
            };
        t.init(function (t, e, a) {
            var i = o.init(t, null, {
                width: e,
                height: a
            });
            return i.setOption(r), i;
        });
    },
    initPieEcharts: function () {
        var t = this.selectComponent("#echats-income-pie"),
            e = {
                legend: {
                    top: "bottom"
                },
                toolbox: {
                    show: !0,
                    feature: {
                        saveAsImage: {
                            show: !0
                        }
                    }
                },
                series: [{
                    name: "收入占比",
                    type: "pie",
                    radius: [15, 50],
                    center: ["50%", "50%"],
                    roseType: "area",
                    label: {
                        formatter: "{name|{b}}\n{time|{c} 元}",
                        rich: {
                            time: {
                                fontSize: 10,
                                color: "#999"
                            }
                        }
                    },
                    data: this.data.income_dynamic
                }]
            };
        t.init(function (t, a, i) {
            var n = o.init(t, null, {
                width: a,
                height: i
            });
            return n.setOption(e), n;
        });
    },
    initFansEcharts: function () {
        var t = this.selectComponent("#echats-fans"),
            e = Math.max.apply(Math, a(this.data.fans_fission.totalFansSeries)) || 50,
            i = Math.max.apply(Math, a(this.data.fans_fission.fansNewSeries)) || 50,
            n = e / 5 || 5,
            s = i / 5 || 5,
            r = {
                tooltip: {
                    trigger: "axis",
                    axisPointer: {
                        type: "cross",
                        crossStyle: {
                            color: "#999"
                        }
                    }
                },
                toolbox: {
                    feature: {
                        saveAsImage: {}
                    }
                },
                legend: {
                    data: ["粉丝总数", "单日新增粉丝"]
                },
                xAxis: {
                    type: "category",
                    boundaryGap: !1,
                    data: this.data.fans_fission.x_axis,
                    axisPointer: {
                        type: "shadow"
                    }
                },
                yAxis: [{
                    type: "value",
                    name: "总数",
                    min: 0,
                    max: e,
                    interval: n
                }, {
                    type: "value",
                    name: "单日",
                    min: 0,
                    max: i,
                    interval: s
                }],
                series: [{
                    name: "粉丝总数",
                    type: "line",
                    color: "#77c399",
                    data: this.data.fans_fission.totalFansSeries
                }, {
                    name: "单日新增粉丝",
                    type: "line",
                    yAxisIndex: 1,
                    color: "#f19c70",
                    data: this.data.fans_fission.fansNewSeries
                }]
            };
        t.init(function (t, e, a) {
            var i = o.init(t, null, {
                width: e,
                height: a
            });
            return i.setOption(r), i;
        });
    },
    initOrderEcharts: function () {
        var t = this.selectComponent("#echats-fans-line"),
            e = Math.max.apply(Math, a(this.data.fans_fission.orderCountSeries)) || 50,
            i = Math.max.apply(Math, a(this.data.fans_fission.orderPriceSeries)) || 50,
            n = e / 5 || 5,
            s = i / 5 || 5,
            r = {
                tooltip: {
                    trigger: "axis",
                    axisPointer: {
                        type: "cross",
                        crossStyle: {
                            color: "#999"
                        }
                    }
                },
                toolbox: {
                    feature: {
                        magicType: {
                            show: !0,
                            type: ["line", "bar"]
                        },
                        saveAsImage: {
                            show: !0
                        }
                    }
                },
                legend: {
                    data: ["订单金额", "订单数量"]
                },
                xAxis: {
                    type: "category",
                    boundaryGap: !1,
                    data: this.data.fans_fission.x_axis,
                    axisPointer: {
                        type: "shadow"
                    }
                },
                yAxis: [{
                    type: "value",
                    name: "订单金额",
                    min: 0,
                    max: i,
                    interval: s
                }, {
                    type: "value",
                    name: "订单数量",
                    min: 0,
                    max: e,
                    interval: n
                }],
                series: [{
                    name: "订单金额",
                    type: "bar",
                    color: "#f19c70",
                    data: this.data.fans_fission.orderPriceSeries
                }, {
                    name: "订单数量",
                    type: "line",
                    yAxisIndex: 1,
                    color: "#77c399",
                    data: this.data.fans_fission.orderCountSeries
                }]
            };
        t.init(function (t, e, a) {
            var i = o.init(t, null, {
                width: e,
                height: a
            });
            return i.setOption(r), i;
        });
    },
    tabChange: function (t) {
        var e, a;
        "income_statistic_type" === (e = t.currentTarget.dataset.type) ? (a = t.currentTarget.dataset.data_type,
            this.setData({
                income_statistic_type: a
            }), this.getIncomeStatistic(a)) : "charts_type" === e ? (a = t.detail.index, this.setData({
            charts_type: a
        }), this.getEchats(a)) : "available_type" === e ? (a = t.detail.index, this.setData({
            available_type: a
        })) : "fans_type" === e ? (a = t.detail.index, this.setData({
            fans_type: a
        }), this.getFans(a)) : "extension_type" === e && (a = t.detail.index, this.setData({
            extension_type: a
        }), this.getExtension(a));
    },
    getIncomeStatistic: function (t) {
        var e = this;
        wx.showLoading({
            title: "加载中"
        });
        var a = r.getNetAddresss("finance.income-page.income-statistic");
        r._getNetWork({
            url: a,
            data: {
                income_statistic_type: t
            },
            success: function (t) {
                wx.hideLoading();
                var a = t.data;
                1 == a.result ? (e.setData({
                    income_statistic: a.data
                }), e.countToNumber()) : wx.showToast({
                    title: a.msg,
                    icon: "none",
                    duration: 1500
                });
            },
            fail: function (t) {
                wx.hideLoading(), console.log(t);
            }
        });
    },
    getEchats: function (t) {
        var e = this,
            a = r.getNetAddresss("finance.income-page.income-charts");
        r._getNetWork({
            url: a,
            data: {
                charts_type: t
            },
            success: function (a) {
                var i = a.data;
                1 == i.result ? (e.setData({
                    income_dynamic: i.data
                }), 1 == t ? e.initPieEcharts() : e.initEcharts()) : wx.showToast({
                    title: i.msg,
                    icon: "none",
                    duration: 1500
                });
            },
            fail: function (t) {
                console.log(t);
            }
        });
    },
    getFans: function (t) {
        var e = this,
            a = r.getNetAddresss("finance.income-page.fans-charts");
        r._getNetWork({
            url: a,
            data: {
                charts_type: t
            },
            success: function (a) {
                var i = a.data;
                1 == i.result ? (e.setData({
                    fans_fission: i.data
                }), 1 == t ? e.initOrderEcharts() : e.initFansEcharts()) : wx.showToast({
                    title: i.msg,
                    icon: "none",
                    duration: 1500
                });
            },
            fail: function (t) {
                console.log(t);
            }
        });
    },
    getExtension: function (t) {
        var e = this;
        this.setData({
            extension_order: {}
        }), this.data.isLoadMore = !1;
        var a = r.getNetAddresss("finance.income-page.extension");
        r._getNetWork({
            url: a,
            data: {
                extension_type: t
            },
            success: function (t) {
                e.data.isLoadMore = !0;
                var a = t.data;
                1 == a.result ? e.setData({
                    extension_order: a.data
                }) : wx.showToast({
                    title: a.msg,
                    icon: "none",
                    duration: 1500
                });
            },
            fail: function (t) {
                console.log(t);
            }
        });
    },
    getMoreData: function () {
        var t = this;
        if (this.data.isLoadMore = !1, this.data.extension_order.current_page >= this.data.extension_order.last_page) this.data.isLoadMore = !1;
        else {
            this.data.extension_order.current_page += 1;
            var e = r.getNetAddresss("finance.income-page.extension");
            r._getNetWork({
                url: e,
                data: {
                    page: this.data.extension_order.current_page,
                    extension_type: this.data.extension_type
                },
                success: function (e) {
                    t.data.isLoadMore = !0;
                    var a = e.data;
                    if (1 == a.result) {
                        var i = a.data.data;
                        t.data.extension_order.data = t.data.extension_order.data.concat(i), t.setData({
                            extension_order: t.data.extension_order
                        });
                    } else wx.showToast({
                        title: a.msg,
                        icon: "none",
                        duration: 1500
                    });
                },
                fail: function (t) {
                    console.log(t);
                }
            });
        }
    },
    countToNumber: function () {
        for (var t = this, a = function (a) {
                var i = t.data.income_statistic[a].value;
                if (Number(i) > 0) var o = new n.default({
                    from: i,
                    speed: 500,
                    refreshTime: 100,
                    decimals: 2,
                    onUpdate: function () {
                        t.setData(e({}, "income_statistic[".concat(a, "].value"), o.tempValue));
                    }
                });
            }, i = 0; i < this.data.income_statistic.length; i++) a(i);
    },
    _getExtensionData: function () {
        var t = this,
            e = r.getNetAddresss("finance.income-page.index");
        r._getNetWork({
            url: e,
            success: function (e) {
                var a = e.data;
                if (1 == a.result) {
                    if (t._setTemplate(a.data.template_set), a.data.income_page.small_jump_link) return void wx.showToast({
                        title: "没有推广资格",
                        icon: "none",
                        duration: 2e3,
                        success: function () {
                            wx.reLaunch({
                                url: a.data.income_page.small_jump_link,
                                fail: function (t) {
                                    wx.reLaunch({
                                        url: "/packageG/index/index"
                                    });
                                }
                            });
                        }
                    });
                    if (!r._isTextEmpty(a.data.income_page.info)) {
                        if ("01" == t.data.template) {
                            if (t.data.income_page) return;
                            t.setData({
                                income_page: a.data.income_page,
                                share_page: a.data.income_page.button_enabled.share_page,
                                income_statistic: a.data.income_page.income_statistic,
                                income_dynamic: a.data.income_page.income_dynamic,
                                fans_fission: a.data.income_page.fans_fission,
                                extension_order: a.data.income_page.extension_order,
                                service: a.data.income_page.service,
                                is_show_unable: a.data.income_page.button_enabled.is_show_unable || !1,
                                show_member_id: a.data.income_page.button_enabled.show_member_id || !1,
                                withdraw_date: a.data.income_page.button_enabled.withdraw_date || !1
                            }), wx.setNavigationBarColor({
                                frontColor: "#ffffff",
                                backgroundColor: t.data.themeBaseColor,
                                animation: {
                                    duration: 400,
                                    timingFunc: "easeIn"
                                }
                            }), t.data.isLoadMore = !0, t.countToNumber(), setTimeout(function () {
                                t.calculateHeight();
                            }, 500);
                        } else t.setData({
                            share_page: a.data.income_page.parameter.share_page,
                            showEarning: a.data.income_page.parameter.plugin_settle_show,
                            is_show_performance: a.data.income_page.is_show_performance || !1,
                            is_show_unable: a.data.income_page.is_show_unable || !1,
                            show_member_id: a.data.income_page.show_member_id || !1,
                            withdraw_date: a.data.income_page.withdraw_date || !1
                        });
                        if ("02" == t.data.template){
                            wx.setNavigationBarColor({
                                frontColor: "#ffffff",
                                // backgroundColor: t.data.themeBaseColor,
                                backgroundColor: '#DAE9FF',
                                animation: {
                                    duration: 400,
                                    timingFunc: "easeIn"
                                }
                            })
                        }
                        
                        a.data.income_page.available = a.data.income_page.available.filter(function (t) {
                            return "" != t.mini_url;
                        }), a.data.income_page.unavailable = a.data.income_page.unavailable.filter(function (t) {
                            return "" != t.mini_url;
                        }), t.setData({
                            userInfo: a.data.income_page.info,
                            extension:t.data.fuShow ?[...a.data.income_page.available,...a.data.income_page.unavailable] : a.data.income_page.available,
                            unextension:t.data.fuShow ? [] : a.data.income_page.unavailable
                        }), a.data.income_page && a.data.income_page.withdraw_limit && (t.setData({
                            is_show_limit: a.data.income_page.withdraw_limit.is_show
                        }), t.data.is_show_limit && t.setData({
                            amount_num: a.data.income_page.withdraw_limit.amount
                        })), 1 == a.data.income_page.member_auth_pop_switch && 0 == a.data.income_page.info.has_avatar && t.setData({
                            editMemberPopupShow: !0
                        });

                        if(t.data.fuShow){
                            t.setData({
                                fuAll:t.getFuPrice('all'),
                                fuzhaoshang:t.getFuPrice('招商'),
                                fushouyin:t.getFuPrice('自提奖励'),
                                fuziti:t.getFuPrice('门店收银台'),
                                fumendian:t.getFuPrice('门店提现'),
                            })
                        }
                        

                    }
                }
                t.setData({
                    firstshow: !0
                });
            },
            fail: function (t) {
                console.log(t.msg);
            }
        });
    },
    editMemberPopupClose: function (t) {
        t.detail.avatar && this.setData({
            "userInfo.avatar": t.detail.avatar
        }), t.detail.name && this.setData({
            "userInfo.nickname": t.detail.name
        }), console.log(t, this.data.userInfo);
    },
    _setTemplate: function (t) {
        t.extension ? this.setData({
            template: t.extension.name
        }) : this.setData({
            template: "01"
        });
        var e = wx.getStorageSync("yz_basic_info");
        e && 1 === e.home.item.is_decorate && (0 != e.home.item.ViewSet.extension.is_default ? this.setData({
            template: e.home.item.ViewSet.extension.code.substring(9)
        }) : this.setData({
            template: "01"
        }));
    },
    gotoIncome: function () {
        var t = r.getNetAddresss("member.member.withdrawByMobile");
        r._getNetWork({
            url: t,
            success: function (t) {
                var e = t.data;
                1 == e.result ? 1 == e.data.is_bind_mobile ? wx.navigateTo({
                    url: "/packageA/member/withdrawEditmobile/withdrawEditmobile"
                }) : wx.navigateTo({
                    url: "/packageA/member/withdrawal/withdrawal"
                }) : wx.showToast({
                    icon: "none",
                    title: e.msg,
                    duration: 1500
                });
            },
            fail: function (t) {
                console.log(t.msg);
            }
        });
    },
    getTemplate: function () {
        var t = this,
            e = r.getNetAddresss("member.member.getMiniTemplateCorrespond");
        r._getNetWork({
            url: e,
            data: {
                small_type: 3
            },
            success: function (e) {
                var a = e.data;
                if (1 == a.result) {
                    for (var i = [], n = 0; n < a.data.length; n++) i.push(a.data[n].template_id);
                    t.setData({
                        TemplateArray: i
                    }), wx.requestSubscribeMessage({
                        tmplIds: t.data.TemplateArray,
                        success: function (e) {
                            t.gotoIncome();
                        },
                        fail: function (e) {
                            console.log(e), t.gotoIncome();
                        }
                    });
                } else wx.showToast({
                    title: a.msg,
                    icon: "none",
                    duration: 1500
                });
            },
            fail: function (t) {
                console.log(t);
            }
        });
    },
    showMoreIdentity: function () {
        this.setData({
            moreIdentity: !this.data.moreIdentity
        });
    },
    calculateHeight: function () {
        var t = this,
            e = wx.createSelectorQuery();
        e.selectAll(".eChats-box1").boundingClientRect(), e.exec(function (e) {
            t.setData({
                showChatsLineHeight: e[0][0].top + e[0][0].height + 250 - t.data.clientHeight
            }), t.data.showChatsLineHeight < 30 && (t.setData({
                showLineChats: !0
            }), t.initEcharts());
        });
        var a = wx.createSelectorQuery();
        a.selectAll(".eChats-box2").boundingClientRect(), a.exec(function (e) {
            t.setData({
                showChatsHeight: e[0][0].top + e[0][0].height + 350 - t.data.clientHeight
            });
        });
    },
    toToast: function () {
        wx.showToast({
            title: this.data.withdraw_date.day_msg,
            icon: "none"
        });
    },
    gotoIncomeBtn: function () {
        this.getTemplate();
    },
    gomyIncome: function () {
        wx.navigateTo({
            url: "/packageA/member/extension/MyIncome/MyIncome"
        });
    },
    myEarnings: function () {
        wx.navigateTo({
            url: "/packageA/member/extension/myEarnings/myEarnings"
        });
    },
    gotoDetail: function () {
        wx.navigateTo({
            url: "/packageA/member/extension/incomedetails/incomedetails"
        });
    },
    gotoRecharge: function () {
        wx.navigateTo({
            url: "/packageA/member/presentationRecord_v2/presentationRecord_v2?orderType=extension"
        });
    },
    gotoPerformance: function () {
        wx.navigateTo({
            url: "/packageA/member/extension/Performance/Performance"
        });
    },
    openService: function () {
        console.log(this.data.service, "dddddddddddddd"), this.data.service && "string" == typeof this.data.service ? wx.navigateTo({
            url: this.data.service,
            fail: function (t) {
                r.tips("客服链接设置错误");
            }
        }) : this.setData({
            showPopup: !0
        });
    },
    closeService: function () {
        this.setData({
            showPopup: !1
        });
    },
    pluginGoto: function (t) {
        var e = t.currentTarget.dataset.item,
            a = e.url;
        "courier" == e.name ? (wx.setStorage({
            key: "couriername",
            data: e.title
        }), wx.navigateTo({
            url: "/packageA/member/" + a + "/" + a
        })) : "HotelManage" == e.url ? wx.navigateTo({
            url: "/packageA/hotel/HotelManage/HotelManage?title=" + encodeURIComponent("酒店管理")
        }) : "cloudIndex" == e.url ? wx.navigateTo({
            url: "/packageE/others/cloudwarehouse/cloud_index/cloud_index"
        }) : "collageIndex" == e.url ? wx.navigateTo({
            url: "/packageE/member/collage/collageIndex/collageIndex"
        }) : "m-erweima" == e.name ? this.openQrCode(this.data.dataIs) : e.mini_url && wx.navigateTo({
            url: e.mini_url
        });
    },
    openQrCode: function (t) {
        this.setData({
            isshow: !0
        });
    },
    clicktapshow: function () {
        this.setData({
            isshow: !1,
            lsgow: !1
        });
    },
    closeCallblack: function (t) {
        this.setData({
            isshow: t.detail.isshow
        });
    },
    gotoBtn: function (t) {
        var e = t.currentTarget.dataset.item;
        "withdrawal" === e.url && (this.data.withdraw_date && this.data.withdraw_date.disable || this.data.userInfo.auto_withdraw && this.data.withdraw_date && !this.data.withdraw_date.disable) ? this.data.withdraw_date && this.data.withdraw_date.disable && this.toToast() : e.mini_url && wx.navigateTo({
            url: e.mini_url
        });
    },
    gotoPage: function (t) {
        var e = t.currentTarget.dataset.item;
        if (e == 'sj') {
            wx.navigateTo({
                url: '/packageK/hxt/dataDisplay/dataDisplay',
            })
            return
        } else if (e == 'gl') {
            let id = wx.getStorageSync('uid')
            var t = r.getNetAddresss("Baoxian.getAuthority");
            r._postNetWork({
                url: t,
                data: {
                    uid: id
                },
                success(l) {
                    let d = l.data
                    if (d.result == 1) {
                        wx.navigateTo({
                            url: '/packageK/hxt/manage/manage',
                        })
                    }else{
                        wx.showToast({
                          title: d.msg,
                          icon:"none"
                        })
                    }
                }
            })
            return

        }
        if (e.is_relation)
            if (e.is_agent)
                if ("point_activity" === e.mark) {
                    if ("point_activity_award_center" == e.url) return void wx.navigateTo({
                        url: "/packageB/member/enterprise/" + e.url + "/" + e.url + "?num=" + this.data.userInfo.member_id
                    });
                    wx.navigateTo({
                        url: "/packageA/member/" + e.url + "/" + e.url + "?num=" + this.data.userInfo.member_id
                    });
                } else "HotelCashier" == e.url ? wx.navigateTo({
                    url: "/packageA/hotel/HotelManage/HotelManage?title=" + encodeURIComponent("收银台")
                }) : e.mini_url && wx.navigateTo({
                    url: e.mini_url
                });
        else wx.navigateTo({
            url: "/packageA/member/extension/ExtensionApply/ExtensionApply"
        });
        else {
            wx.showToast({
                icon: "none",
                title: "未开放该权限！",
                duration: 1500
            });
        }


    },
    firstlogin: function () {
        var t = !1;
        try {
            wx.getStorageSync("wx_token") ? (this.setData({
                loginshow: !1
            }), t = !1) : (this.setData({
                loginshow: !0
            }), t = !0);
        } catch (e) {
            this.setData({
                loginshow: !0
            }), t = !0;
        }
        return t;
    },
    gotologin: function () {
        r.seyzredirect(), wx.navigateTo({
            url: "/pages/login/login"
        });
    },
    customizeIncome: function () {
        try {
            var t = wx.getStorageSync("mailLanguage");
            if (t) {
                var e = JSON.parse(t);
                this.setData({
                    income_name_text: e.income.income_name || "收入",
                    name_of_withdrawal: e.income.name_of_withdrawal || "提现"
                });
            }
        } catch (t) {
            this.setData({
                income_name_text: "收入",
                name_of_withdrawal: "提现"
            });
        }
    },
    getFuPrice(type){
        let price = 0
        this.data.extension.forEach(item=>{
            if(item.title == type){
                price = item.value
            }
            if(type == "all" && (item.title=='招商'||item.title=='自提奖励'||item.title=='门店收银台'||item.title=='门店提现')){
                price += item.value
            }
        })
        return price
    }
});